Repository navigation
chore(wsl): log what a Sleep's folder read saw for each terminal - #35150
Conversation
|
STATUS: ready. Head 0f7c5da, from origin/main a6fdeda. Each Sleep now logs one info line: which read ran, budget, distro rows, pane-shell count, distro and pane known, live, and whether a folder was found. No behavior change. Checks: pnpm tc, typecheck:ci, 9 daemon test files (125 tests passing), code-quality, anti-slop, oxlint, ast-grep scan and gates. Note: #35141 edits the same Sleep block (it renames the Sleep folder map, sleepShellCwds → probedShellCwds), so whichever merges second needs a small rebase. |
|
No actionable comments were generated in the recent review.
|
0f7c5da to
14eb406
Compare
|
STATUS: rebased onto main bafe4d5 (includes #35141, so the per-pane folder map is now probedShellCwds). Head 14eb406. Conflicts resolved in daemon-wsl-sleep-cwd.ts: the facts read now also takes #35141's optional time cap, and the at-quit read is kept. Added daemon-pty-adapter-wsl-sleep-cwd-relaunch.test.ts (the reload/relaunch regression tests). Checks: pnpm tc, typecheck:ci, 11 daemon test files (138 tests passing), code-quality, anti-slop, oxlint, ast-grep scan and gates. Not merged. |
…trace (#35378) * chore(wsl): keep the Sleep folder and bridge-exit lines in the local trace A packaged build keeps no console, so #35150's Sleep folder line and the WSL bridge exit verdict were invisible on a device. Each now also goes to main.trace.ndjson as a span with the line and its facts as filterable fields. Co-Authored-By: Claude <noreply@anthropic.com> * fix(wsl): keep session paths and distro names out of the persisted WSL trace --------- Co-authored-by: Claude <noreply@anthropic.com>
ELI5
On the WSL test machine, a terminal paused by a project move sometimes comes back in the project's top folder instead of the folder the shell was in. The code that records that folder hasn't changed, so we can't tell from the code why it fails. This adds one log line per terminal Sleep that says what Orca tried and what it found, so the next device run shows the cause.
What Changed
Before: a Sleep that failed to learn a WSL bridge terminal's folder left no trace. The terminal just woke in the folder it was started in.
After: every Sleep logs one info line. For example:
[history] Sleep folder for <session>: wsl probe (budget 750ms, rows 12, shells 1), distro Ubuntu, pane <tab>:<leaf>, live true, folder found in 84msThe line names:
wsl probe: the read inside the distro for bridge panes.live probe: the read for native shells.nonewhen it wasn't read, was refused, or timed out (timed outis added in that case).unknownmeans it didn't know the pane was a WSL pane.Mechanism:
readDaemonWslSleepCwdnow delegates toreadDaemonWslSleepCwdWithFacts, which returns those counts with the folder. Its result is unchanged.daemon-live-sleep-cwd.ts, so the session-control file stays under its line limit.Why
The only lead on the device regression is a checkpoint that ended up at the project root. Each of the three possible causes leaves a different value on this line:
unknowndistro or paneshells 2rows none timed outThe alternative, asking the user to collect process tables by hand, isn't reliable mid-move.
Flag-off: no behavior change with
ORCA_INTERNAL_WSL_HOSTSunset. Every Sleep, on any platform, adds one info line to the main log.User-risk: none to behavior. One log line per terminal Sleep. It contains internal session and pane ids and a distro name; no folder paths or terminal contents.
Linked Issue
On-device WSL verification, 5e: a bridge pane paused by a move woke at the project root.
Visual Proof
N/A. Logging only.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
daemon-pty-adapter-wsl-sleep-cwd.test.ts: a real adapter Sleep of a WSL bridge pane logs exactly one line naming the wsl probe,rows 2, shells 1, distro, pane andfolder found.daemon-wsl-sleep-cwd.test.ts:shells 2with no foldertimed outNew
daemon-pty-adapter-wsl-sleep-cwd-relaunch.test.ts: regression tests that a bridge pane still keeps its folder at Sleep after a renderer reload or app relaunch. Covers:Checks run:
pnpm tc,pnpm run typecheck:ci, 11 daemon test files (138 tests passing, including the Sleep-folder, quit-folder (#35141), history, distro-loss relaunch, cold-restore and fenced-termination suites),pnpm run check:code-quality:changed, anti-slop oxlint, oxlint (max-lines), ast-grep scan and gates.Review
Agent skill upstream boundary
Notes
live probe.Status
Ready for review. Rebased onto main after #35141. Intended to ship in the next device build. Device runs show a fresh pane keeps its folder through both a move pause and Sleep → Wake; only one earlier pane lost it once, so this line is meant to catch the intermittent case.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)